package com.atilim.cargo.business;

import java.util.List;
import java.util.Map;

import javax.ejb.Stateless;

import com.atilim.cargo.model.Customer;
import com.atilim.cargo.model.User;


@Stateless
public class AdministrationBean extends BaseBean {


	public void insertUser (User user)  {
		this.insertObject(user);
	}
	
	
	public void updateUser (User user)  {
		this.updateObject(user);
	}
	
	
	public void deleteUser (long userId)  {
		this.deleteObject(this.getObject(User.class, userId));
	}
	
	public List<User> searchUser (Map<String, Object> params) {
		List<User> result = this.find(User.class, params);
		return result;
	}
	
	public void insertCustomer (Customer customer)  {
		this.insertObject(customer);
	}

	public void updateCustomer (Customer customer)  {
		this.updateCustomer(customer);
	}

	public List<Customer> searchCustomer (Map<String, Object> params) {
		List<Customer> result = this.find(Customer.class, params);
		
		return result;
	}
	
	public Customer getCustomer (long id) {
		return this.getObject(Customer.class, id);
	}

}
